
#pragma once
#ifndef __SWIG__
#include <D3DX11tex.h>
#endif

#include "CDXResource.h"
#ifdef __SWIG__
%include <typemaps.i>
%include "mui_typemap.i"

%apply SWIGTYPE** OUTPUT { ID3D11UnorderedAccessView** ppUnorderAccessView};
%apply SWIGTYPE** OUTPUT { ID3D11ShaderResourceView** ppShaderResourceView};
%apply SWIGTYPE** OUTPUT { ID3D11RenderTargetView** ppRenderTargetView};
%apply SWIGTYPE* OUTPUT {D3D11_TEXTURE2D_DESC* pOutDesc};
#endif
class CDXTexture3D : public CDXResource
{
protected:
	//override CDXResource

	virtual HRESULT ReleaseResources();

protected:
	ID3D11Texture3D* m_pTexture;
public:
	CDXTexture3D(CDXDevice* pDevice);
	virtual ~CDXTexture3D();

	virtual ID3D11Texture3D* GetD3D11Texture3D();

	virtual HRESULT Create(D3D11_TEXTURE3D_DESC* pDesc, D3D11_SUBRESOURCE_DATA* pInitData = NULL);

	virtual HRESULT Resize(UINT width, UINT height, UINT depth);
	virtual HRESULT SaveToFile(LPCWSTR path);
	virtual HRESULT LoadFromFile(LPCWSTR path, D3DX11_IMAGE_LOAD_INFO* pImageInfo = NULL);
	// override CDXDXResource
	virtual HRESULT OpenShareHandle(HANDLE hResource);
	virtual ID3D11Resource* GetResource() const;
	virtual HRESULT GetDesc(D3D11_TEXTURE3D_DESC* pOutDesc);



	using CDXResource::GetShaderResourceView;
	using CDXResource::GetUnorderedAccessView;
	using CDXResource::GetRenderTargetView;
	virtual HRESULT GetShaderResourceView(DXGI_FORMAT fmt, UINT MostDetailedMip, UINT MipLevels, ID3D11ShaderResourceView** ppShaderResourceView);
	virtual HRESULT GetUnorderedAccessView(DXGI_FORMAT fmt, UINT MipSlice, UINT FirstWSlice, UINT WSize, ID3D11UnorderedAccessView** ppUnorderAccessView);
	virtual HRESULT GetRenderTargetView(DXGI_FORMAT fmt, UINT MipSlice, UINT FirstWSlice, UINT WSize, ID3D11RenderTargetView** ppRenderTargetView);
};
